﻿<ResourceDictionary
	xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
	xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
	xmlns:esriToolkit="clr-namespace:ESRI.ArcGIS.Client.Toolkit"
    >
	
	<Style TargetType="esriToolkit:Attribution">
		<Setter Property="Background" Value="Transparent"/>
		<Setter Property="BorderBrush" Value="Transparent"/>
		<Setter Property="BorderThickness" Value="0"/>
		<Setter Property="IsTabStop" Value="False" />
		<Setter Property="IsHitTestVisible" Value="False" />

		<Setter Property="Template">
			<Setter.Value>
				<ControlTemplate TargetType="esriToolkit:Attribution">
					<Border Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="5">
						<ItemsControl ItemsSource="{Binding Items, RelativeSource={RelativeSource TemplatedParent}}" >
											<ItemsControl.ItemTemplate>
								<DataTemplate>
									<ContentPresenter ContentTemplate="{Binding AttributionTemplate}" Content="{Binding}">
										<ContentPresenter.Resources>
											<Style TargetType="TextBlock">
												<Style.Triggers>
													<Trigger Property="Text" Value="">
														<Setter Property="Visibility" Value="Collapsed" />
													</Trigger>
													<Trigger Property="Text" Value="{x:Null}">
														<Setter Property="Visibility" Value="Collapsed" />
													</Trigger>
												</Style.Triggers>
											</Style>
										</ContentPresenter.Resources>
									</ContentPresenter>
								</DataTemplate>
							</ItemsControl.ItemTemplate>
						</ItemsControl>
					</Border>
				</ControlTemplate>
			</Setter.Value>
		</Setter>
	</Style>
</ResourceDictionary>